package edu.yuhf.web.controller;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import edu.yuhf.dao.iface.UserDao;


@Controller("testController")
@RequestMapping("/test")
public class TestController {
	
	@Resource(name="userDao")
	UserDao userDao;
	
	@RequestMapping("/first")
	public String hello(@RequestParam("name") String name, ModelMap model){
		List<Map<String, Object>> list=userDao.queryAll();
		for(Map<String,Object> map:list){
			System.out.println(map.get("name"));
		}
		model.put("hello", name);
        return "main";
	}

}
